﻿using Stateless;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace TestStateMachine_Stateless_
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
        #region 状态机
        StateMachine<State, Trigger> sm;
        //TODO 子状态的定义
        enum Trigger
        {
            StartMeasure,
            StartCalibrate,
            StartStand,
            Continue,
            Stop,
            ConnectException,
            Error,
            EmergencyStop
        }
        enum State
        {
            initialization,
            Warning,
            Wait,
            Reset,
            MeshIn,
            MeshOut,
            Measure,
            Calibrate,
            Stand,
            Load,
            Unload
        }
        private void InitState()
        {
            sm.Configure(State.initialization)
                .OnEntry(() => InitializeDevice())
                .OnEntry()
        }
        #endregion
    }
}
